package interfaces;

public interface GameBoard {
	/**
	 * Returns the current board state.
	 * @return char[][] - the current board state
	 */
	char[][] getBoard();
	
	/**
	 * Returns the list of available moves as an array.
	 * Moves in the list are 2-character strings.
	 * The first character is the row letter (A, B, or C).
	 * The second character is the column number (1, 2, or 3).
	 * @return String[] - array of available moves
	 */
	String[] getAvailableMoves();
	
	/**
	 * Attempt to apply player's move to board
	 * @param move - the move to be applied to the board
	 * @param player - the player whose move is being applied
	 * @return boolean - true if move is valid, false otherwise
	 */
	boolean playMove(String move, int player);
	
	/**
	 * Play the move as the current player.
	 * Wrapper function for playMove(String,int).
	 * @param move - the move to be applied to the board
	 * @return boolean - true if move is valid, false
	 */
	boolean playMove(String move);
	
	/**
	 * Determines if the board is in a winning state
	 * @return boolean - true if the board is in a winning state, false otherwise
	 */
	boolean hasWin();
	
	/**
	 * Determines if the board is in a draw state
	 * @return boolean - true if the board is in a draw state, false otherwise
	 */
	boolean hasDraw();
	
	/**
	 * Determine the current player (who's turn it is now)
	 * @return int - the current player's ID
	 */
	int getCurrentPlayer();
	
	/**
	 * Return the most recent move made on the board
	 * @return String - the most recent move on the board
	 */
	String getLastMove();
	
	/**
	 * Returns a String which contains the pretty-printed board
	 * @return String - pretty-printed representation of the board
	 */
	String toString();
	
	/**
	 * Converts array indices into String representation of a move
	 * @param idx - indices of move, e.g. {2,0}
	 * @return String - String representation of the move, e.g. "C0"
	 */
	String toMove(int[] idx);
	
	/**
	 * Converts String representation of move into array indices
	 * @param move - String representation of move, e.g. "B2"
	 * @return int[] - array indices of move, e.g. {1,2}
	 */
	public int[] toIndices(String move);
	
}
